<!--mstp,sdh,ipran正常变更用户名称变更-->
<script>
import Common from "@/mixins/order/commonbg.js";
import OrderService from "@/api/order/OrderService.js";
import CustOrderService from "@/api/order/CustOrderService";
import PPMForm from "@/crm3.0part7-ppm/core/ppmForm.vue";
export default {
  name: "mstp10461041",
  mixins: [PPMForm, Common],
  data() {
    return {
      //mstp,sdh,ipran正常变更用户名称变更
    };
  },
  async mounted() {
      await this.initCommon();

  },

  computed: {},
  methods: {
    //创建甲乙端客户
    async getInputGridValue(val,flag){
       if(flag && flag == 'input'){
          if (val.data == "") return;
          if(val.key == '10461261-100012972' || val.key == '10461262-100012972'){
            let result = await CustOrderService.qryAZCustId({ custName: val.data });
            if (result.code == 200) {
              if (result.meta.resultCode == 0) {
                if(val.key == '10461261-100012972'){
                  this.formData["10461261-100012972"].text = val.data;
                  this.formData["10461261-100012972"].value = result.meta.custId;
                }else {
                  this.formData["10461262-100012972"].text = val.data;
                  this.formData["10461262-100012972"].value = result.meta.custId;
                }
              } else {
                if(val.key == '10461261-100012972'){
                  this.formData["10461261-100012972"].text = '';
                  this.formData["10461261-100012972"].value = '';
                  this.$alert("创建甲乙端客户失败", "提示", { type: "warning" });
                }else {
                  this.formData["10461262-100012972"].text = '';
                  this.formData["10461262-100012972"].value = '';
                  this.$alert("创建甲乙端客户失败", "提示", { type: "warning" });
                }
              }
            }
          }
       }
    },
    isModContactLimit() {
      if(this.formData["10461259-142000765"].value=='1'){
        this.SetRequired({ attrName:'合同终止日期', formkey:'10461259-142002037', reqName:'empty', reqStatus:true});
      }else{
        this.SetRequired({ attrName:'合同终止日期', formkey:'10461259-142002037', reqName:'empty', reqStatus:false});
      }
    },
  },
};
</script>

